﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 类的使用
{
    class person
    {
        public person(string name, int age, char gender)
        {
            this.name = name;
            this.Age = age;
            this.gender = gender;
        }
        public string name;
        private int _age;
        public int Age
        {
            get { return _age; }
            set
            {
                if (value < 0)
                {
                    value = 0;
                }
                _age = value;
            }
        }

        public char gender;

        public void Skill()
        {
            Console.WriteLine($"我是{name},我今年{Age}岁,我是{gender}性,我的大招是摆烂");
        }
        public void SayHello()
        {
            Console.WriteLine($"大家好，我是{name},我今年{Age}岁");
        }
    }
}